<template>
  <div>
    <div class="header">
      <img
        src="../../assets/images/fanhui.png"
        height="23"
        alt=""
        @click="back"
      />
      <div>块体评价单</div>
      <div @click="btn">提交</div>
    </div>
    <div class="pin">
      <p>总体评分</p>
      <div>{{ value * 2 }}分</div>
      <van-rate v-model="value" :icon="imgSrc" :void-icon="imgSrc1" />
    </div>
    <div class="pinlist">
      <p>店铺评分</p>
      <div>
        <span>店铺评分</span>
        <van-rate v-model="value1" :icon="imgSrc22" :void-icon="imgSrc11" />
      </div>
      <div>
        <span>物流速度</span>
        <van-rate v-model="value2" :icon="imgSrc33" :void-icon="imgSrc11" />
      </div>
      <div>
        <span>物流评分</span>
        <van-rate v-model="value3" :icon="imgSrc44" :void-icon="imgSrc11" />
      </div>
    </div>
    <textarea
      name=""
      v-model="val"
      id=""
      cols="30"
      rows="10"
      placeholder="写几句评价"
    ></textarea>

   <div class="footer">
     <van-uploader v-model="fileList" multiple :max-count="5" />
     <img src="../../assets/images/delete.png" width="20" alt="">
   </div>
  </div>
</template>

<script>
import { starPJ} from "../../request/api";
export default {
  data() {
    return {
      value3: 1,
      value2: 1,
      value1: 1,
      value: 1,
      val: "123",
      imgSrc44: require("../../assets/images/评分-红.png"),
      imgSrc33: require("../../assets/images/评分-橙.png"),
      imgSrc22: require("../../assets/images/评分-黄.png"),
      imgSrc11: require("../../assets/images/评分-灰.png"),
      imgSrc: require("../../assets/images/xiaolian.png"),
      imgSrc1: require("../../assets/images/shangxin.png"),
      fileList: [],
    };
  },
  
  methods: {
    back() {
      this.$router.back();
    },

    btn() {
      this.$router.back();
      let code = this.$route.query.data;
      let id = this.$route.query.id;
      console.log(code);
      console.log(id);
      starPJ({
        shop: this.value1,
        logistics: this.value2,
        express: this.value3,
        totalScore: this.value,
        orderCode: code,
        id: id,
        info: this.val,
      }).then((res) => {
        if (res.errCode == 0) {
          console.log(res);
        }
      });
    },
  },
};
</script>
 
<style lang = "less" scoped>
.footer{
  position: relative;
  img{
    position: absolute;
    top: 6px;
    left: 55px;
  }
}
/deep/.van-uploader__upload{
  background: #003399;
}
textarea {
  width: 100%;
  outline: none;
  box-sizing: border-box;
  border: none;
}
* {
  padding: 0;
  margin: 0;
}
.pinlist {
  margin-bottom: 10px;
  background: #fff;
  box-sizing: border-box;
  width: 100%;
  p {
    padding: 15px 0;
    padding-left: 10px;
    width: 100%;
    border-bottom: 1px solid #999;
    box-sizing: border-box;
  }
  div {
    display: flex;
    align-items: center;
    padding: 4px 20px;
    spam {
      display: block;
      margin-bottom: 5px;
    }
  }
}
/deep/.van-rate__icon {
  margin-right: 10px;
  font-size: 33px;
}
.pin {
  background: #fff;
  border-bottom: 1px solid #999;
  padding-bottom: 20px;
  text-align: center;
  p {
    text-align: center;
    font-size: 14px;
    color: #666;
  }
  div {
    font-size: 30px;
    color: #ffd21e;
  }
}
.header {
  width: 100vw;
  height: 64px;
  background: #003399;
  display: flex;
  justify-content: space-around;
  color: #fff;
  font-size: 22px;
  padding: 25px 10px;
  box-sizing: border-box;
}
</style>